Skip to content

chore(bench): disable mimalloc purge delay for codspeed cpu simulation#274

Merged
stormslowly merged 1 commit into
mainfrom
ci/codspeed-mimalloc-purge-delay
Jun 9, 2026
Merged

chore(bench): disable mimalloc purge delay for codspeed cpu simulation#274
stormslowly merged 1 commit into
mainfrom
ci/codspeed-mimalloc-purge-delay

Conversation

@stormslowly

Copy link
Copy Markdown
Collaborator

Why

Mimalloc delayed purging can call clock_gettime during CPU simulation measurements, leaking allocator timing noise into CodSpeed stage benchmarks. Setting MIMALLOC_PURGE_DELAY=-1 on the simulation run keeps that noise out while leaving the memory run unchanged.

Ports web-infra-dev/rspack#14321 to this repo. Only the CI workflow change applies here — there is no bench:rust:local script or xtask/benchmark/README.md to mirror.

This repo uses mimalloc as the global allocator in benches/resolver.rs, so the same purge-noise concern applies.

Mimalloc delayed purging can call clock_gettime during CPU simulation
measurements, adding allocator timing noise to CodSpeed stage benchmarks.
Set MIMALLOC_PURGE_DELAY=-1 on the simulation run to keep that noise out
while leaving memory runs unchanged.
Copilot AI review requested due to automatic review settings June 9, 2026 06:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the benchmark CI workflow to reduce allocator-related timing noise during CodSpeed CPU (simulation) benchmarks by disabling mimalloc’s delayed purge behavior for that run only.

Changes:

  • Set MIMALLOC_PURGE_DELAY=-1 for the CodSpeed CPU benchmark step (mode: simulation) to avoid clock_gettime noise from delayed purging.
  • Leave the memory benchmark step unchanged to preserve existing behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds the environment variable MIMALLOC_PURGE_DELAY: "-1" to the CPU benchmark job step in the GitHub Actions workflow. This setting disables memory purge delay for the miMalloc allocator during benchmark simulation mode. The change affects only the benchmark workflow configuration and does not modify any workflow logic, steps, triggers, or permissions.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for adding the MIMALLOC_PURGE_DELAY environment variable and its impact on benchmark measurements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main change: adding MIMALLOC_PURGE_DELAY=-1 to disable mimalloc purge delay for codspeed CPU simulation in the benchmark workflow.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/codspeed-mimalloc-purge-delay

Comment @coderabbitai help to get the list of available commands and usage tips.

@stormslowly stormslowly enabled auto-merge (squash) June 9, 2026 06:35
@codspeed-hq

codspeed-hq Bot commented Jun 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing ci/codspeed-mimalloc-purge-delay (21f4cd4) with main (02dbd01)

Open in CodSpeed

@stormslowly stormslowly changed the title ci: disable mimalloc purge delay for codspeed cpu simulation chore(bench): disable mimalloc purge delay for codspeed cpu simulation Jun 9, 2026
@stormslowly stormslowly merged commit cde1737 into main Jun 9, 2026
26 checks passed
@stormslowly stormslowly deleted the ci/codspeed-mimalloc-purge-delay branch June 9, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants